﻿using Grpc.Core;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace gRPCService.Services
{
    public class OrderService:OrderGrpc.OrderGrpcBase
    {
        private readonly ILogger<OrderService> _logger;
        public OrderService(ILogger<OrderService> logger)
        {
            _logger = logger;
        }


        public override Task<CreateOrderResult> CraeteOrder(CreateOrderCommand request, ServerCallContext context)
        {
            //return base.CraeteOrder(request, context);
            return Task.FromResult(new CreateOrderResult
            {
                Order = request.ProductId + 222
            });
        }

        public override Task<CreateOrderResult> UpdateOrder(CreateOrderCommand request, ServerCallContext context)
        {
            return base.UpdateOrder(request, context);
        }
    }
}
